<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/IncludeTop.jsp"%>
<html>
<head>
<base href="<%=basePath%>">
<title>输入比分</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function settlethis(tdtag)
{
  var tr = $(tdtag).parents("tr")[0];
  document.settleForm.compid.value = $("input[@name=compid]", tr).attr("value");
  document.settleForm.full.value = $("input[@name=fullhome]", tr).attr("value") + ":" + $("input[@name=fullroad]", tr).attr("value");
  document.settleForm.half.value = $("input[@name=halfhome]", tr).attr("value") + ":" + $("input[@name=halfroad]", tr).attr("value");
  document.settleForm.submit();
}
</script>
</head>

<body>

<table width="100%" border="1" cellspacing="0" cellpadding="0" id="comps_input">
	<tr>
		<th scope="col">联赛</th>
		<th scope="col">主/客</th>
		<th scope="col">日期/时间</th>
		<th scope="col">比分</th>
		<th scope="col">操作</th>
	</tr>

	<c:forEach var="comp" items="${requestScope.comps}">
		<tr cid="<c:out value="${comp.id}"/>">
			<td><c:out value="${comp.home.name_zh}" /> <br>
			<c:out value="${comp.road.name_zh}" /></td>
			<td><fmt:formatDate value="${comp.time}" type="both" /></td>
			<td>
			<input type="hidden" name="compid" value="<c:out value="${comp.id}"/>">
			全场：<input maxlength="5" type="text" name="fullhome" value="<c:out value="${comp.fullResult}"/>"><input maxlength="5" type="text" name="fullroad" value="<c:out value="${comp.fullResult}"/>"><br>
			半场：<input maxlength="5" type="text" name="halfhome" value="<c:out value="${comp.halfResult}"/>"><input maxlength="5" type="text" name="halfroad" value="<c:out value="${comp.halfResult}"/>">
			</td>
			<td><input type="button" value="结算" onclick="settlethis(this)"></td>
			<td><c:out value="${comp.league.name_zh}" /></td>
		</tr>
	</c:forEach>

</table>
<form name="settleForm" action="mgr/settleComp.do">
<input name="compid" type="hidden" value=""/>
<input name="half" type="hidden" value=""/>
<input name="full" type="hidden" value=""/>
</form></body>
</html>
